package com.zebra.common;


import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 和 session 所处位置对应
 */
public enum TmsServerType {

    LOBBY(0), //大厅
    Slots(1), //
    Chess(2),
    Fishing(3),
    GAME(9);  //游戏中


    private final int code;

    TmsServerType(final int code) {
        this.code = code;
    }

    private final static Map<Integer, TmsServerType> map  = Arrays.stream(TmsServerType.values()).collect(Collectors.toMap(TmsServerType::code, t -> t));

    public int code() {
        return this.code;
    }

    public static TmsServerType codeOf(int code){
        return map.get(code);
    }

}
